/**
 * 
 */
package kr.co.insoft.core.service.configration.connection;

import java.util.List;

import kr.co.insoft.core.model.configration.connection.ConnectionEntityModel;
import kr.co.insoft.core.model.paging.PagingModel;
import kr.co.insoft.framework.exceptions.ServiceException;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author skpark
 * 
 */
public interface ConnectionService {

	/**
	 * Connection 목록
	 * 
	 * @return
	 * @throws ServiceException
	 */
	public PagingModel getLists(PagingModel pagingModel)
			throws ServiceException;

	/**
	 * Connection 등록
	 * 
	 * @return
	 * @throws ServiceException
	 */
	@CacheEvict({"connections", "connection"})
	@Transactional(rollbackFor = ServiceException.class)
	public void createConnection(ConnectionEntityModel connectionEntityModel)
			throws ServiceException;

	/**
	 * Connection 상세
	 * 
	 * @param connectionid
	 * @return
	 * @throws ServiceException
	 */
	@Cacheable("connection")
	public ConnectionEntityModel getArticle(String connectionid)
			throws ServiceException;

	/**
	 * Connection 삭제
	 * 
	 * @param connectionEntityModel
	 * @throws ServiceException
	 */
	@CacheEvict({"connections", "connection"})
	public void removeConnection(ConnectionEntityModel connectionEntityModel)
			throws ServiceException;

	/**
	 * 사용자 및 조직의 Connection List 호출
	 * 
	 * @return
	 * @throws ServiceException
	 */
	@Cacheable("connections")
	public List<ConnectionEntityModel> getAllLists() throws ServiceException;

}
